<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>成绩录入表</title>
<style type="text/css">
body,td,th {
	font-size: 14px;
}
.table1 {
	border-top:#003 1px solid;
	border-right:#003 1px solid;
}
.table1 td {
	border-bottom:#003 1px solid;
	border-left:#003 1px solid;
	padding:3px 4px 3px 4px;
}
</style>
</head>
<body>
<?php
$conn=mysql_connect('127.0.0.1:3306','betty','123qwe');
mysql_query("SET NAMES 'utf8'",$conn);
mysql_select_db('betty',$conn);
$id=$_GET['id'];
$name=$_POST['name'];
$gender=$_POST['gender'];
$point=$_POST['point'];
$sql="UPDATE `scord1` SET `name`='$name',`gender`='$gender',`point`='$point' WHERE `id`='$id'";
$return=mysql_query($sql,$conn);
	if($return){
		echo '保存成功！';
	}else{
		echo '保存失败！';
	}

?>
<form id="form1" name="form1" method="post" action="3list.php">
<table border="0" align="center" cellpadding="0" cellspacing="0" class="table1">
<tr>
    <td colspan="2" align="center">成绩录入表</td>
    </tr>
  <tr>
    <td>姓名</td>
    <td><input type="text" name="name" id="textfield" value="<?php echo $row['name'];?>" /></td>
  </tr>
  <tr> 
    <td>性别</td>
    <td>
<label><input name="gender" type="radio" id="radio" value="1"<?php if($row['gender']==1){?> checked="checked"<? } ?> />男</label>
<label><input name="gender" type="radio" id="radio2" value="2"<?php if($row['gender']==2){?> checked="checked"<? } ?> />女</label>
</td>
  </tr>
  <tr>
    <td>分数</td>
    <td><input type="text" name="point" id="textfield2" value="<?php echo $row['point'];?>"/></td>
  </tr>
  <tr>
    <td colspan="2" align="center"><input type="submit" name="button" id="button" value="保存" />
<a href="4edit.php">返回</a></td>
  </tr>
</table>
</form>
</body>
</html>
